import java.util.concurrent.*;

public class Test {
    //匿名内部类
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(3);
        Future<Integer> a = executorService.submit(new Callable<Integer>() {
            @Override
            public Integer call() throws Exception {
                System.out.println("aaaaaaaaaaaaaaaaaaaa");
                return 3;
            }
        });
        executorService.shutdown();
        try {
            System.out.println(a.get());
        } catch (InterruptedException | ExecutionException e) {
            e.printStackTrace();
        }
    }
}
